##############################################
##  Makefile _ LCD Display - Temporal DevC  ##
##					    ##
##  UFPE/CIn - Greco			    ##
##					    ##
##  By Rafael Melo Macieira		    ##
##  rmm2@cin.ufpe.br			    ##
##############################################

BUILDPATH = built/
BUILDFILE = $(BUILDPATH)$@
OBJS = tdc_automata.o tdc_automata_drv_init.o tdc_automata_drv_send_data_pre.o tdc_automata_drv_setcontrast_pre.o tdc_automata_engine.o main.o
MAINFILE = $(CPPPATH)main.cpp
CC = g++
APPNAME = lcd_display
OUTPUT = $(APPNAME).x
CFLAG = -o $(OUTPUT)
CPPPATH = 
HEADERPATH = headers/
HEADERS = $(HEADERPATH)*.h  #tdc_automata_drv_init.h $(HEADERPATH)tdc_automata_drv_send_data_pre.h $(HEADERPATH)tdc_automata.h

lcd_display.x : $(OBJS)
	$(CC) $(BUILDPATH)*.o $(MAINFILE) $(CFLAG)
	@echo "\n** Finalizado!\n"

#main.o : $(MAINFILE) $(HEADERS) main.h
#	$(CC) -c $(MAINFILE) -o $(BUILDFILE)

%.o : %.cpp $(HEADERPATH)%.h $(HEADERPATH)tdc_automata.h
	 $(CC) -o $(BUILDPATH)$@ -c $<

clean:
	@echo "\nRemovendo $(OBJS) e $(OUTPUT)\n"
	rm -f $(BUILDPATH)*.o $(OUTPUT) *~ ./headers/*~
	@echo "\n** Finalizado!\n"

clean-do: clear lcd_display.x